#! 
# by jzhang @ 15:33 2004-01-14  mailto:v-jzhang
# demostrate list slice
# 

$_ = 'the quick brown fox jumped over the lazy dog';
print "---------simple list slice---------\n";
($fox,$dog)=(split /\s/)[3,8];
print $fox,"\n",$dog,"\n";

print "------min and max---------\n";
($min,$max) = (sort split/\s/)[0,-1]; # -1 means the last element
print $min,"\n",$max,"\n";

print "-----hash list slice-------\n";
%scores = (
	   John=>120,
	   Mary=>200,
	   Henry=>160,
	   Peter=>130,
	   Rose=>80
	   );
@two_scores = @scores{qw/Henry Rose/};
grep {$_+=100} @two_scores;
@scores{qw/Henry Rose/} = @two_scores;
grep {print "$_=>$scores{$_}\n"} sort  keys %scores;
